//package com.ruyuan.redis;
//
//import com.ruyuan.redis.impl.RedisClientImpl;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.DependsOn;
//import redis.clients.jedis.JedisPool;
//import redis.clients.jedis.JedisPoolConfig;
//
//import java.time.Duration;
//
///**
// * @author xx
// */
//@Configuration
////@EnableConfigurationProperties(JsRedisProperties.class)
//public class JsRedisAutoConfiguration {
//
//    @DependsOn("jsRedisProperties")
//    @Bean(destroyMethod = "destroy")
//    public RedisClient redisClient(JsRedisProperties properties) {
//        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
//        jedisPoolConfig.setMaxIdle(properties.getMaxIdle());
//        jedisPoolConfig.setMaxTotal(properties.getMaxTotal());
//        jedisPoolConfig.setMaxWait(Duration.ofMillis(properties.getMaxWaitMillis()));
//        JedisPool jedisPool = new JedisPool(jedisPoolConfig, properties.getHost(), properties.getPort(),
//                properties.getTimeout(), properties.getPassword());
//        return new RedisClientImpl(jedisPool);
//    }
//
//}
